import request from '@/utils/request'

/**
 * 查询最近更新动态数据
 * @returns 
 */
export const getLatestNotesService = () => {
    return request.get('/user/notes/latest')
}

/**
 * 根据id查询动态数据
 * @param {*} id 
 * @returns 
 */
export const getNoteByIdService = (id) => {
    return request.get(`/user/notes/${id}`)
}

/**
 * 查询所有可用动态数据
 * @param {*} query 
 * @returns 
 */
export const getNotesListService = (query) => {
    return request.get('/user/notes', {
        params: query
    })
}

/**
 * 查询动态对应评论内容数据
 * @param {*} notesId 
 * @returns 
 */
export const getNotesCommentListService = (notesId) => {
    return request.get(`/user/notes/comments/${notesId}`)
}

/**
 * 用户评论动态数据
 * @param {*} comment 
 * @returns 
 */
export const userAddCommentsSetvice = (comment) => {
    return request.post('/user/notes/user/comment', comment)
}

/**
 * 用户点赞动态
 * @param {*} id 
 * @returns 
 */
export const userAddNoteLikeService = (id) => {
    return request.put(`/user/notes/like/${id}`)
}